/*----------------------------------------------------------------------------*/
/* Copyright (c) FIRST 2008. All Rights Reserved.							  */
/* Open Source Software - may be modified and shared by FRC teams. The code   */
/* must be accompanied by the FIRST BSD license file in $(WIND_BASE)/WPILib.  */
/*----------------------------------------------------------------------------*/
#ifndef SERVO_H
#define SERVO_H

/**
 * Standard hobby style servo
 */
class Servo : public PWM
{
public:
	Servo(unsigned channel);
	Servo(unsigned slot, unsigned channel);
	virtual ~Servo(void);
	void Set(float value);
	float Get(void);
	void SetAngle(float angle);
	float GetAngle(void);
	float GetMaxAngle(void) { return kMaxServoAngle; };
	float GetMinAngle(void) { return kMinServoAngle; };

private:
	void InitServo(void);
	float GetServoAngleRange(void) {return kMaxServoAngle - kMinServoAngle;}

	static const int kMaxPwm = 245;
	static const int kMinPwm = 11;
	static const float kMaxServoAngle = 170.0;
	static const float kMinServoAngle = 0.0;
};

#endif

